# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=ruby-rouge
_gemname=rouge
pkgver=4.2.0
pkgrel=1
pkgdesc="A pure Ruby code highlighter that is compatible with Pygments"
url="https://github.com/rouge-ruby/rouge"
arch="noarch"
license="MIT AND BSD-2-Clause"
depends="ruby"
checkdepends="ruby-minitest ruby-rake"
source="https://github.com/rouge-ruby/rouge/archive/v$pkgver/ruby-rouge-$pkgver.tar.gz"
builddir="$srcdir/$_gemname-$pkgver"
options="!check"  # FIXME: run tests

build() {
	gem build $_gemname.gemspec
}

package() {
	local gemdir="$pkgdir/$(ruby -e 'puts Gem.default_dir')"
	local geminstdir="$gemdir/gems/$_gemname-$pkgver"

	gem install \
		--local \
		--install-dir "$gemdir" \
		--bindir "$pkgdir/usr/bin" \
		--ignore-dependencies \
		--no-document \
		--verbose \
		$_gemname

	# Remove unnecessary files and rubbish...
	cd "$gemdir"
	rm -r cache build_info doc extensions

	rm "$geminstdir"/Gemfile
}

sha512sums="
b0dd5fb3ec2ebb1e7cd50460ea589026e70e5ee8b7b55a9a9c48990f22d3845a5a1bb7ce83001f5316852568c8bc7bca3ee2db9deacd60cde2b42ea9ba391d18  ruby-rouge-4.2.0.tar.gz
"
